package com.hddznet.uniplatform.sm.vo.request;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.hddznet.uniplatform.sm.entity.BusZyPreparStepEntity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel(value="ReqZyPreparStep", description="作业准备步骤新增对象")
public class ZyPreparStepAddReq {

	@ApiModelProperty(value = "作业类型", name = "zyType", required = true,  example = "")
	@JsonProperty(value = "zyType")
	private String zyType;
	
	@ApiModelProperty(value = "作业大类", name = "category", required = true,  example = "")
	private String category;
	
	@ApiModelProperty(value = "检查项", name = "checkItem", required = true,  example = "")
	private String checkItem;
	
	@ApiModelProperty(value = "作业准备", name = "zyPrepar", required = true,  example = "")
	private String zyPrepar;
	
	@ApiModelProperty(value = "作业步骤", name = "zyStep", required = true,  example = "")
	private Integer zyStep;
	
	@ApiModelProperty(value = "指标监测", name = "zyMonitoring", required = false,  example = "")
	private String zyMonitoring;
	
	@ApiModelProperty(value = "备注", name = "remark", required = false,  example = "")
	private String remark;
	
	public static BusZyPreparStepEntity fromEntity(ZyPreparStepAddReq req) {
		BusZyPreparStepEntity entity = new BusZyPreparStepEntity();
		entity.setZyType(req.getZyType());
		entity.setCategory(req.getCategory());
		entity.setCheckItem(req.getCheckItem());
		entity.setZyPrepar(req.getZyPrepar());
		entity.setZyMonitoring(req.getZyMonitoring());
		entity.setZyStep(req.getZyStep());
		entity.setRemark(req.getRemark());
		entity.setDefaultStatus();
		return entity;
	}
}
